package com.hzspace.es;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * TODO
 *
 * @Version 1.0
 * @Author hz
 * @Date 2020/11/25 18:04
 */
@Component
public interface ArticleRepository extends ElasticsearchRepository<Article, Integer> {

    List<Article> findAllByTitleOrContent(String text);

    List<Article> findAllByTitleLikeOrContentLike(String title, String content);

    Page<Article> findByContentLike(String content, Pageable pageable);

    Page<Article> findByContent(String content, Pageable pageable);

}
